package xiao_jin.fantastic_journey.generator;

import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.registry.tag.ItemTags;
import xiao_jin.fantastic_journey.core.init.ModItems;
import xiao_jin.fantastic_journey.core.init.ModTags;

import java.util.concurrent.CompletableFuture;

public final class ModItemTagProvider extends FabricTagProvider.ItemTagProvider {
    public ModItemTagProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> completableFuture) {
        super(output, completableFuture);
    }

    @Override
    protected void configure(RegistryWrapper.WrapperLookup arg) {
        getOrCreateTagBuilder(ItemTags.BOW_ENCHANTABLE)
                .add(ModItems.RESONANCE)
        ;
        getOrCreateTagBuilder(ItemTags.CROSSBOW_ENCHANTABLE)
                .add(ModItems.END_BREATHING)
        ;
        getOrCreateTagBuilder(ModTags.WAND)// 魔杖
                .add(ModItems.WAND_APPRENTICE)
                .add(ModItems.WAND_WOODEN)
        ;

        getOrCreateTagBuilder(ModTags.DAGGER)// 匕首
                .add(ModItems.DAGGER_WOOD)
                .add(ModItems.DAGGER_STONE)
                .add(ModItems.DAGGER_IRON)
                .add(ModItems.DAGGER_GOLD)
                .add(ModItems.DAGGER_DIAMOND)
                .add(ModItems.DAGGER_EMERALD)
                .add(ModItems.DAGGER_NETHERITE)
        ;
        getOrCreateTagBuilder(ModTags.LONGSWORD)// 长剑
                .add(ModItems.LONGSWORD_WOOD)
                .add(ModItems.LONGSWORD_STONE)
                .add(ModItems.LONGSWORD_IRON)
                .add(ModItems.LONGSWORD_GOLD)
                .add(ModItems.LONGSWORD_DIAMOND)
                .add(ModItems.LONGSWORD_EMERALD)
                .add(ModItems.LONGSWORD_NETHERITE)
        ;
        getOrCreateTagBuilder(ModTags.BROADSWORD)// 大剑/宽剑
                .add(ModItems.BROADSWORD_WOOD)
                .add(ModItems.BROADSWORD_STONE)
                .add(ModItems.BROADSWORD_IRON)
                .add(ModItems.BROADSWORD_GOLD)
                .add(ModItems.BROADSWORD_DIAMOND)
                .add(ModItems.BROADSWORD_EMERALD)
                .add(ModItems.BROADSWORD_NETHERITE)
        ;
        getOrCreateTagBuilder(ModTags.RAPIER)// 礼剑
                .add(ModItems.RAPIER_WOOD)
                .add(ModItems.RAPIER_STONE)
                .add(ModItems.RAPIER_IRON)
                .add(ModItems.RAPIER_GOLD)
                .add(ModItems.RAPIER_DIAMOND)
                .add(ModItems.RAPIER_EMERALD)
                .add(ModItems.RAPIER_NETHERITE)
        ;
    }
}
